package cn.xuewenbao.edu.controller;


import cn.xuewenbao.edu.entity.vo.ChildSubjectVo;
import cn.xuewenbao.edu.service.ChildSubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author mafayu
 * @since 2021-07-08
 */
@RestController
@RequestMapping("/edu/child-subject")
@Api(tags = "子分类表")
public class ChildSubjectController {

    @Autowired
    private ChildSubjectService childSubjectService;

    //获取一级分类下的所有子分类
    @ApiOperation("获取一级分类下的所有子分类")
    @GetMapping("getAllChildSubject/{parentId}")
    public Result<List<ChildSubjectVo>> getAllChildSubject(@PathVariable String parentId) {
        Result<List<ChildSubjectVo>> result = childSubjectService.getAllChildSubject(parentId);
        return result;
    }


}

